<?php
/**
 * @package		YiCiCMS
 * @version		2.X
 * @copyright	[C] 2012 - 2099, www.yicicms.com
 * @author		[QQ]492495899 <longx1001@qq.com>
 * $Id: index.php 1 2013-1-31 22:57:52 $
 */
$startTime = microtime(true);
$startMem = memory_get_usage();

header ( 'Content-Type: text/html; charset=gb2312' );

define ( 'APP_NAME', '' );
define ( 'APP_PATH', getcwd () . '/' );
define ( 'CACHE_PATH', APP_PATH . 'cache/' );
define ( 'PAGE', (isset ( $_REQUEST ['page'] ) && intval ( $_REQUEST ['page'] ) != 0) ? intval ( $_REQUEST ['page'] ) : 1 );

require APP_PATH.'core/_init.php';
$obj = core::instance();
$obj->init();

if (!is_file('./tpl.php')) {
    $tpl = new template();
    $tpl->loadTemplate('index.html');
    $tpl->ParseTemplete();
    file_put_contents('./tpl.php', $tpl->SourceString);
}
include './tpl.php';

echo 'sqlnum:'.D()->querynum.'<br />';
echo 'runtime:'.round((microtime(true) - $startTime)*1000, 3).'<br />';
$size = memory_get_usage()-$startMem;
$unit=array('b','kb','mb','gb','tb','pb');
echo round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i].'<br />';